#!/usr/bash


if [ $# -lt 2 ];then
	echo $0 "<onnx_model>  <trt_model>\n"
	exit -1
fi

source  /ai-cephfs/Share/paraspace/trt7-related/trt-7-related-path.sh

tool=/ai-cephfs/Share/paraspace/trt7-related/TensorRT-7.2.2.3/bin/trtexec
onnx_model=$1
trt_model=$2
device=2
input_dim=2320
min_frames=1
max_frames=6000
memory_size=256
$tool --device=$device --tacticSources=-cublasLt --explicitBatch --minShapes=input:1x${min_frames}x$input_dim \
--maxShapes=input:1x${max_frames}x$input_dim --optShapes=input:1x500x$input_dim \
--shapes=input:1x1000x$input_dim --workspace=$memory_size --onnx=$onnx_model --saveEngine=$trt_model

echo 'Done.'
